Optimal. Leaf size=47 \[ \frac {1}{2} a (2 A+B) x+\frac {a (A+B) \sin (c+d x)}{d}+\frac {a B \cos (c+d x) \sin (c+d x)}{2 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.01, antiderivative size = 47, normalized size of antiderivative = 1.00, number of steps
used = 1, number of rules used = 1, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.048, Rules used = {2813}
\begin {gather*} \frac {a (A+B) \sin (c+d x)}{d}+\frac {1}{2} a x (2 A+B)+\frac {a B \sin (c+d x) \cos (c+d x)}{2 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 2813
Rubi steps
\begin {align*} \int (a+a \cos (c+d x)) (A+B \cos (c+d x)) \, dx &=\frac {1}{2} a (2 A+B) x+\frac {a (A+B) \sin (c+d x)}{d}+\frac {a B \cos (c+d x) \sin (c+d x)}{2 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.12, size = 44, normalized size = 0.94 \begin {gather*} \frac {a (2 B c+4 A d x+2 B d x+4 (A+B) \sin (c+d x)+B \sin (2 (c+d x)))}{4 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.08, size = 57, normalized size = 1.21
method | result | size |
risch | \(a x A +\frac {a B x}{2}+\frac {\sin \left (d x +c \right ) a A}{d}+\frac {a B \sin \left (d x +c \right )}{d}+\frac {a B \sin \left (2 d x +2 c \right )}{4 d}\) | \(51\) |
derivativedivides | \(\frac {a B \left (\frac {\sin \left (d x +c \right ) \cos \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+a A \sin \left (d x +c \right )+a B \sin \left (d x +c \right )+a A \left (d x +c \right )}{d}\) | \(57\) |
default | \(\frac {a B \left (\frac {\sin \left (d x +c \right ) \cos \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+a A \sin \left (d x +c \right )+a B \sin \left (d x +c \right )+a A \left (d x +c \right )}{d}\) | \(57\) |
norman | \(\frac {\frac {a \left (2 A +B \right ) \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}+a \left (2 A +B \right ) x \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\frac {a \left (2 A +3 B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d}+\frac {a \left (2 A +B \right ) x}{2}+\frac {a \left (2 A +B \right ) x \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2}}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{2}}\) | \(108\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.26, size = 55, normalized size = 1.17 \begin {gather*} \frac {4 \, {\left (d x + c\right )} A a + {\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} B a + 4 \, A a \sin \left (d x + c\right ) + 4 \, B a \sin \left (d x + c\right )}{4 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.36, size = 38, normalized size = 0.81 \begin {gather*} \frac {{\left (2 \, A + B\right )} a d x + {\left (B a \cos \left (d x + c\right ) + 2 \, {\left (A + B\right )} a\right )} \sin \left (d x + c\right )}{2 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 94 vs.
\(2 (42) = 84\).
time = 0.08, size = 94, normalized size = 2.00 \begin {gather*} \begin {cases} A a x + \frac {A a \sin {\left (c + d x \right )}}{d} + \frac {B a x \sin ^{2}{\left (c + d x \right )}}{2} + \frac {B a x \cos ^{2}{\left (c + d x \right )}}{2} + \frac {B a \sin {\left (c + d x \right )} \cos {\left (c + d x \right )}}{2 d} + \frac {B a \sin {\left (c + d x \right )}}{d} & \text {for}\: d \neq 0 \\x \left (A + B \cos {\left (c \right )}\right ) \left (a \cos {\left (c \right )} + a\right ) & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.42, size = 45, normalized size = 0.96 \begin {gather*} \frac {1}{2} \, {\left (2 \, A a + B a\right )} x + \frac {B a \sin \left (2 \, d x + 2 \, c\right )}{4 \, d} + \frac {{\left (A a + B a\right )} \sin \left (d x + c\right )}{d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.19, size = 50, normalized size = 1.06 \begin {gather*} A\,a\,x+\frac {B\,a\,x}{2}+\frac {A\,a\,\sin \left (c+d\,x\right )}{d}+\frac {B\,a\,\sin \left (c+d\,x\right )}{d}+\frac {B\,a\,\sin \left (2\,c+2\,d\,x\right )}{4\,d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________